
package com.scs.application.modules.cert.mapper;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.scs.application.modules.cert.dto.NoticeUpgradeCertDTO;
import com.scs.application.modules.cert.dto.NoticeUploadCertDTO;
import com.scs.application.modules.cert.entity.CertificateRepository;
import com.scs.application.modules.cert.request.CertificateRepositoryQueryRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 供应商资质仓库 mapper对象
 *
 */
@Mapper
public interface CertificateRepositoryMapper extends BaseMapper<CertificateRepository> {

    IPage<CertificateRepository> page(IPage page, @Param("request") CertificateRepositoryQueryRequest request);

    List<CertificateRepository> list(@Param("request") CertificateRepositoryQueryRequest request);

    IPage<CertificateRepository> pageForSupplierWarning(IPage page, @Param("request") CertificateRepositoryQueryRequest request);

    IPage<CertificateRepository> pageForHospitalWarning(IPage page, @Param("request") CertificateRepositoryQueryRequest request);

    List<CertificateRepository> pageForAudit( @Param("request") CertificateRepositoryQueryRequest request);

    List<NoticeUploadCertDTO> listForHospitalUpload(@Param("request") CertificateRepositoryQueryRequest request);

    List<NoticeUpgradeCertDTO> listForHospitalUpgrade(@Param("request") CertificateRepositoryQueryRequest request);

    int countForHospital(@Param("hospitalId") String hospitalId);

    int countForSupplier(@Param("supplierId") String supplierId);


    /***
     * @Description:  资质预警，分页查询
     */
    Page<CertificateRepository> pageWarn(IPage page, @Param(Constants.WRAPPER) QueryWrapper<CertificateRepository> wrapper, @Param("params") Map<String,Object> params, @Param("userParam") Map<String,Object> userParam);


    /***
     * @Description:  资质预警，分页查询
     */
    List<CertificateRepository> listWarn(@Param(Constants.WRAPPER) QueryWrapper<CertificateRepository> wrapper, @Param("userParam") Map<String,Object> userParam);


    /***
     * @Description:  资质预警，计数查询
     */
    int countWarn(@Param(Constants.WRAPPER) QueryWrapper<CertificateRepository> wrapper, @Param("userParam") Map<String,Object> userParam);




    /***
     * @Description:  资质维护，分页查询
     */
    Page<CertificateRepository> pageCurd(IPage page, @Param(Constants.WRAPPER) QueryWrapper<CertificateRepository> wrapper, @Param("params") Map<String,Object> params, @Param("userParam") Map<String,Object> userParam);


    /***
     * @Description:  资质预警，单个
     */
    CertificateRepository getByIdForWarn( @Param("id") String id);

}
